package com.wu.serviceimp;

import com.wu.dao.NewsDao;
import com.wu.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ArticleServiceImp
 * @Author xwu36
 * @Date 2019/2/18 15:14
 * @Version 1.0
 * @Description
 **/
@Service("articleService")
public class ArticleServiceImp implements ArticleService {

    @Autowired
    NewsDao dao;

    @Override
    public List<Map> getArticle(int currentPage, int pageSize) {
        int next=(currentPage-1)*pageSize;
        List<Map> articleList = dao.articlePaging(next, pageSize);
        return articleList;
    }

    @Override
    public List<Map> getNews(String newsType) {
        List<Map> newsList = dao.NewsList(newsType);
        return newsList;
    }
}
